import ProcessDesign from "@/components/Bpmn/ProcessManage/ProcessDesign";
import {useEffect} from "react";

const CustomDiagramEditor = (
    {
        value,
        onChange,
        curSection,
    }:{
        value?:any;
        onChange?:(val:any)=>void;
        curSection:AircasKB.Knowledge.SectionItem;
    }
) => {

    //组件初始化函数
    //todo: useEffect函数
    useEffect(() => {
        onChange?.(value??null);
    }, [value])

    //内容改变时触发
    //todo:handleChange,内容改变时触发
    const handleChange = (val:any)=> {
        onChange?.(val);
    };

    return (
        <div>
            <ProcessDesign value={value} onChange={handleChange} curSection={curSection}/>
        </div>
    )
}
export default CustomDiagramEditor;
